package com.hancai.barrage.pagehelper;

import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

/**
 * @author 涵菜
 * @version 1.0
 * 实现分页功能
 */
@Getter
@Setter
public class QueryObject {
    private String keyword;
    //页数
    private Integer pageNum=1;
    //每一页记录条数
    private Integer pageSize=3;
    private Integer getStart(){
        return pageSize*(pageNum-1);
    }
    public void setKeyword(String keyword){
        //关键字不为空且有值
        if(StringUtils.hasText(keyword)){
            this.keyword=keyword;
        }
    }
}
